package com.amado.course28Exception;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
/**
 * 检查性异常可以往外抛或捕获异常
 * 抛给方法的调用者（谁调用我的方法，我就抛给谁处理）
 * @author Administrator
 *
 */
public class S03CheckExceptionThrow {
	public static void main(String[] args){
		print();
	}
	public static void print(){
		File file = new File("E:\\test\\tes1t.txt");
		InputStream input = null;
		try {
			//public FileInputStream(File file) throws FileNotFoundException {
			//查看源码
			input = new FileInputStream(file);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}finally{
			System.out.println("1123");
			if(input!=null){
				try {
					input.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}
}
